
Each DomView can use these internal variables in template files:
<ul>
<li><strong>pageUrl</strong> - Current page url (http://localhost/mySite/Admin/)</li>
<li><strong>siteUrl</strong> - same as pageUrl</li>
<li><strong>rootUrl</strong> - SITE_URL constant value. (http://localhost/mySite/)</li>
<li><strong>controllerUrl</strong> - Current page url with selected controller name (http://localhost/mySite/Admin/Index/)</li>
<li><strong>templateUrl</strong> - Template folder url (http://localhost/mySite/application/view/Admin/)</li>
<li><strong>mediaUrl</strong> - Media (images etc) folder url (http://localhost/mySite/application/media/)</li>
<li><strong>uploadUrl</strong> - Upload folder url (http://localhost/mySite/files/Upload/)<br>
<li><strong>currentUrl</strong> - Currently open url (Value of url address in browser's url line.)<br>

</li>
</ul>
Using them is same like ordinary variables - {literal}{$pageUrl}, {$templateUrl}{/literal} etc.



<h2>Where DomView gets it's templates </h2>


There are two ways to load template files into DomView<br>
This would load template file from <strong>application/views/CONTROLLERS_GROUP/myTemplateFile.html</strong><br>
(CONTROLLERS_GROUP is defined in index.php as DomSite second argument)<br>
{literal}
<pre class="code">
&lt;?php
$view = new DomView('myTemplateFile.html');
?&gt;
</pre>
{/literal}
This would load template file from <strong>application/views/myTemplateFile.html</strong>
NB! Notice slash (/) before filename!
<br><br>



{literal}
<pre class="code">
&lt;?php
$view = new DomView('/myTemplateFile.html');
?&gt;
</pre>
{/literal}
<br><br>



You can also add folder names to template file location!<br>
This would load template file from <strong>application/views/someDir/myTemplateFile.html</strong>
{literal}
<pre class="code">
&lt;?php
$view = new DomView('/someDir/myTemplateFile.html');
?&gt;
</pre>
{/literal}
<br><br>



<h2>Setting up caching view.</h2>
{literal}
<pre class="code">
&lt;?php
class SomeController extends DomController {
	public function someMethod() {
			
		// this will be cached for 60 seconds.	
		$view = new DomView('MyTemplateFile.html', 60, 'myCacheId' );
		
		if( !$view->isCached() ) {
			// do something time intensive that should be cached.
			// For example database queries.
		}
		
		$this->view->contents = $view->fetch();
	}
}
?&gt;
</pre>
{/literal}


